package day11.math;

/**
 * @Auther:小陈的Java
 */
public class MathDemo {
    public static void main(String[] args) {
        //1. abs返回一个数的绝对值
        System.out.println(Math.abs(-5));
        //2. ceil 向上取整
        System.out.println(Math.ceil(1.1));
        //3. floor向下取整
        System.out.println(Math.floor(1.9));
        //4. round四舍五入
        System.out.println(Math.round(4.5));
        //5. max取最大值
        System.out.println(Math.max(1,2));
        //6. min取最小值
        System.out.println(Math.min(1,2));
        //7. random随机数(0-1之间随机包含0不包含1)
        System.out.println(Math.random());
    }
}
